package com.baidu.service;

import com.baidu.dao.GoodsDao;
import com.baidu.entity.GoodsBean;
import com.baidu.entity.SortBean;

import java.util.List;

/**
 * 创作时间：2019/9/20 14:17
 * 作者：李增强
 */
public class GoodsService {
    GoodsDao dao = new GoodsDao();
    public List<GoodsBean> getGoodsList(String sortid) {
        String ssql="";
        if(sortid!=null&&!"-1".equals(sortid)){
            ssql+=" and a.sortid="+sortid;
        }
        return dao.getGoodsList(ssql);
    }

    public List<SortBean> getSortList() {
        return dao.getSortList();
    }

    public GoodsBean getGoodsById(String id) {
        return dao.getGoodsById(id);
    }

    public boolean updateGoods(String buycount, String id) {
        return dao.updateGoods(buycount,id);
    }
}
